package com.spark.lola.entity.pur;

import com.baomidou.mybatisplus.annotation.TableName;
import com.spark.lola.support.common.constant.BooleanConstant;
import com.spark.lola.support.common.entity.ShiroUser;
import com.spark.lola.support.mybatis.entity.BaseModel;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;

/**
 * <p>
 * 采购操作记录
 * </p>
 *
 * @author dengyejun
 * @since 2020-04-24
 */
@TableName("pur_order_process")
@ApiModel(value="OrderProcess对象", description="")
public class OrderProcess extends BaseModel implements Serializable {
    private static final long serialVersionUID=1L;
    public OrderProcess(){}
    public OrderProcess(ShiroUser user,OrderInfo orderInfo,Integer action,String info,String message,String extendJson){
        this.orderId = orderInfo.getId();
        this.orderNo =orderInfo.getNo();
        this.name = user.getLoginNo();
        // 修改处
        if (user.getDutyId() != null) {
            this.userType = user.getDutyId().toString();
        }
        this.userId = user.getId();
        this.action = action;
        this.info = info;
        this.message = message;
        this.extendJson = extendJson;
    }
    @ApiModelProperty(value = "订单id")
    private Long orderId;

        private String orderNo;

    @ApiModelProperty(value = "预留字段，用户id")
    private Long userId;

    @ApiModelProperty(value = "用户类型")
    private String userType;

    @ApiModelProperty(value = "用户名")
    private String name;

    @ApiModelProperty(value = "操作")
    private Integer action;

    @ApiModelProperty(value = "操作内容")
    private String info;

    @ApiModelProperty(value = "描述")
    private String message;

    @ApiModelProperty(value = "扩展")
    private String extendJson;

    @ApiModelProperty(value = "操作时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "最新")
    private Integer flag= BooleanConstant.TRUE;

    public Integer getFlag() {
        return flag;
    }

    public void setFlag(Integer flag) {
        this.flag = flag;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getExtendJson() {
        return extendJson;
    }

    public void setExtendJson(String extendJson) {
        this.extendJson = extendJson;
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }
    
    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }
    
    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }
    
    public String getUserType() {
        return userType;
    }

    public void setUserType(String userType) {
        this.userType = userType;
    }
    
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAction() {
        return action;
    }

    public void setAction(Integer action) {
        this.action = action;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    

}
